{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Introductory examples"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.usa.gov data from bit.ly"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "%pwd\n",
    "context = 'D:/pycharm-code/pydata-book-1st-edition/'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "path = 'ch02/usagov_bitly_data2012-03-16-1331923249.txt'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'{ \"a\": \"Mozilla\\\\/5.0 (Windows NT 6.1; WOW64) AppleWebKit\\\\/535.11 (KHTML, like Gecko) Chrome\\\\/17.0.963.78 Safari\\\\/535.11\", \"c\": \"US\", \"nk\": 1, \"tz\": \"America\\\\/New_York\", \"gr\": \"MA\", \"g\": \"A6qOVH\", \"h\": \"wfLQtf\", \"l\": \"orofrog\", \"al\": \"en-US,en;q=0.8\", \"hh\": \"1.usa.gov\", \"r\": \"http:\\\\/\\\\/www.facebook.com\\\\/l\\\\/7AQEFzjSi\\\\/1.usa.gov\\\\/wfLQtf\", \"u\": \"http:\\\\/\\\\/www.ncbi.nlm.nih.gov\\\\/pubmed\\\\/22415991\", \"t\": 1331923247, \"hc\": 1331822918, \"cy\": \"Danvers\", \"ll\": [ 42.576698, -70.954903 ] }\\n'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "open(context+path).readline()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "path = context+'ch02/usagov_bitly_data2012-03-16-1331923249.txt'\n",
    "records = [json.loads(line) for line in open(path)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{u'a': u'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.78 Safari/535.11',\n",
       " u'al': u'en-US,en;q=0.8',\n",
       " u'c': u'US',\n",
       " u'cy': u'Danvers',\n",
       " u'g': u'A6qOVH',\n",
       " u'gr': u'MA',\n",
       " u'h': u'wfLQtf',\n",
       " u'hc': 1331822918,\n",
       " u'hh': u'1.usa.gov',\n",
       " u'l': u'orofrog',\n",
       " u'll': [42.576698, -70.954903],\n",
       " u'nk': 1,\n",
       " u'r': u'http://www.facebook.com/l/7AQEFzjSi/1.usa.gov/wfLQtf',\n",
       " u't': 1331923247,\n",
       " u'tz': u'America/New_York',\n",
       " u'u': u'http://www.ncbi.nlm.nih.gov/pubmed/22415991'}"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "records[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "u'America/New_York'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "records[0]['tz']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "America/New_York\n"
     ]
    }
   ],
   "source": [
    "print(records[0]['tz'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Counting time zones in pure Python"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "ename": "KeyError",
     "evalue": "'tz'",
     "traceback": [
      "\u001b[1;31m\u001b[0m",
      "\u001b[1;31mKeyError\u001b[0mTraceback (most recent call last)",
      "\u001b[1;32m<ipython-input-13-db4fbd348da9>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mtime_zones\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0mrec\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'tz'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mrec\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mrecords\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mKeyError\u001b[0m: 'tz'"
     ],
     "output_type": "error"
    }
   ],
   "source": [
    "time_zones = [rec['tz'] for rec in records]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "time_zones = [rec['tz'] for rec in records if 'tz' in rec]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[u'America/New_York',\n",
       " u'America/Denver',\n",
       " u'America/New_York',\n",
       " u'America/Sao_Paulo',\n",
       " u'America/New_York',\n",
       " u'America/New_York',\n",
       " u'Europe/Warsaw',\n",
       " u'',\n",
       " u'',\n",
       " u'']"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time_zones[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_counts(sequence):\n",
    "    counts = {}\n",
    "    for x in sequence:\n",
    "        if x in counts:\n",
    "            counts[x] += 1\n",
    "        else:\n",
    "            counts[x] = 1\n",
    "    return counts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "from collections import defaultdict\n",
    "\n",
    "def get_counts2(sequence):\n",
    "    counts = defaultdict(int) # values will initialize to 0\n",
    "    for x in sequence:\n",
    "        counts[x] += 1\n",
    "    return counts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "counts = get_counts(time_zones)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1251"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "counts['America/New_York']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3440"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(time_zones)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "def top_counts(count_dict, n=10):\n",
    "    value_key_pairs = [(count, tz) for tz, count in count_dict.items()]\n",
    "    value_key_pairs.sort()\n",
    "    return value_key_pairs[-n:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[(33, u'America/Sao_Paulo'),\n",
       " (35, u'Europe/Madrid'),\n",
       " (36, u'Pacific/Honolulu'),\n",
       " (37, u'Asia/Tokyo'),\n",
       " (74, u'Europe/London'),\n",
       " (191, u'America/Denver'),\n",
       " (382, u'America/Los_Angeles'),\n",
       " (400, u'America/Chicago'),\n",
       " (521, u''),\n",
       " (1251, u'America/New_York')]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "top_counts(counts)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "from collections import Counter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "counts = Counter(time_zones)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[(u'America/New_York', 1251),\n",
       " (u'', 521),\n",
       " (u'America/Chicago', 400),\n",
       " (u'America/Los_Angeles', 382),\n",
       " (u'America/Denver', 191),\n",
       " (u'Europe/London', 74),\n",
       " (u'Asia/Tokyo', 37),\n",
       " (u'Pacific/Honolulu', 36),\n",
       " (u'Europe/Madrid', 35),\n",
       " (u'America/Sao_Paulo', 33)]"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "counts.most_common(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Counting time zones with pandas"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "from __future__ import division\n",
    "from numpy.random import randn\n",
    "import numpy as np\n",
    "import os\n",
    "import matplotlib.pyplot as plt\n",
    "import pandas as pd\n",
    "plt.rc('figure', figsize=(10, 6))\n",
    "np.set_printoptions(precision=4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "path = context+ 'ch02/usagov_bitly_data2012-03-16-1331923249.txt'\n",
    "lines = open(path).readlines()\n",
    "records = [json.loads(line) for line in lines]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>_heartbeat_</th>\n",
       "      <th>a</th>\n",
       "      <th>al</th>\n",
       "      <th>c</th>\n",
       "      <th>cy</th>\n",
       "      <th>g</th>\n",
       "      <th>gr</th>\n",
       "      <th>h</th>\n",
       "      <th>hc</th>\n",
       "      <th>hh</th>\n",
       "      <th>kw</th>\n",
       "      <th>l</th>\n",
       "      <th>ll</th>\n",
       "      <th>nk</th>\n",
       "      <th>r</th>\n",
       "      <th>t</th>\n",
       "      <th>tz</th>\n",
       "      <th>u</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...</td>\n",
       "      <td>en-US,en;q=0.8</td>\n",
       "      <td>US</td>\n",
       "      <td>Danvers</td>\n",
       "      <td>A6qOVH</td>\n",
       "      <td>MA</td>\n",
       "      <td>wfLQtf</td>\n",
       "      <td>1.331823e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>orofrog</td>\n",
       "      <td>[42.576698, -70.954903]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>http://www.facebook.com/l/7AQEFzjSi/1.usa.gov/...</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://www.ncbi.nlm.nih.gov/pubmed/22415991</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>NaN</td>\n",
       "      <td>GoogleMaps/RochesterNY</td>\n",
       "      <td>NaN</td>\n",
       "      <td>US</td>\n",
       "      <td>Provo</td>\n",
       "      <td>mwszkS</td>\n",
       "      <td>UT</td>\n",
       "      <td>mwszkS</td>\n",
       "      <td>1.308262e+09</td>\n",
       "      <td>j.mp</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[40.218102, -111.613297]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.AwareMap.com/</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/Denver</td>\n",
       "      <td>http://www.monroecounty.gov/etc/911/rss.php</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/4.0 (compatible; MSIE 8.0; Windows NT ...</td>\n",
       "      <td>en-US</td>\n",
       "      <td>US</td>\n",
       "      <td>Washington</td>\n",
       "      <td>xxr3Qb</td>\n",
       "      <td>DC</td>\n",
       "      <td>xxr3Qb</td>\n",
       "      <td>1.331920e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[38.9007, -77.043098]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>http://t.co/03elZC4Q</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://boxer.senate.gov/en/press/releases/0316...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8)...</td>\n",
       "      <td>pt-br</td>\n",
       "      <td>BR</td>\n",
       "      <td>Braz</td>\n",
       "      <td>zCaLwp</td>\n",
       "      <td>27</td>\n",
       "      <td>zUtuOu</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>alelex88</td>\n",
       "      <td>[-23.549999, -46.616699]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/Sao_Paulo</td>\n",
       "      <td>http://apod.nasa.gov/apod/ap120312.html</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...</td>\n",
       "      <td>en-US,en;q=0.8</td>\n",
       "      <td>US</td>\n",
       "      <td>Shrewsbury</td>\n",
       "      <td>9b6kNl</td>\n",
       "      <td>MA</td>\n",
       "      <td>9b6kNl</td>\n",
       "      <td>1.273672e+09</td>\n",
       "      <td>bit.ly</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[42.286499, -71.714699]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.shrewsbury-ma.gov/selco/</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://www.shrewsbury-ma.gov/egov/gallery/1341...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...</td>\n",
       "      <td>en-US,en;q=0.8</td>\n",
       "      <td>US</td>\n",
       "      <td>Shrewsbury</td>\n",
       "      <td>axNK8c</td>\n",
       "      <td>MA</td>\n",
       "      <td>axNK8c</td>\n",
       "      <td>1.273673e+09</td>\n",
       "      <td>bit.ly</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[42.286499, -71.714699]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.shrewsbury-ma.gov/selco/</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://www.shrewsbury-ma.gov/egov/gallery/1341...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1...</td>\n",
       "      <td>pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4</td>\n",
       "      <td>PL</td>\n",
       "      <td>Luban</td>\n",
       "      <td>wcndER</td>\n",
       "      <td>77</td>\n",
       "      <td>zkpJBR</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bnjacobs</td>\n",
       "      <td>[51.116699, 15.2833]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://plus.url.google.com/url?sa=z&amp;n=13319232...</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>Europe/Warsaw</td>\n",
       "      <td>http://www.nasa.gov/mission_pages/nustar/main/...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/2...</td>\n",
       "      <td>bg,en-us;q=0.7,en;q=0.3</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>wcndER</td>\n",
       "      <td>NaN</td>\n",
       "      <td>zkpJBR</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bnjacobs</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.facebook.com/</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td></td>\n",
       "      <td>http://www.nasa.gov/mission_pages/nustar/main/...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Opera/9.80 (X11; Linux zbov; U; en) Presto/2.1...</td>\n",
       "      <td>en-US, en</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>wcndER</td>\n",
       "      <td>NaN</td>\n",
       "      <td>zkpJBR</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bnjacobs</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.facebook.com/l.php?u=http%3A%2F%2F1...</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td></td>\n",
       "      <td>http://www.nasa.gov/mission_pages/nustar/main/...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...</td>\n",
       "      <td>pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>zCaLwp</td>\n",
       "      <td>NaN</td>\n",
       "      <td>zUtuOu</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>alelex88</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://t.co/o1Pd0WeV</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td></td>\n",
       "      <td>http://apod.nasa.gov/apod/ap120312.html</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2)...</td>\n",
       "      <td>en-us,en;q=0.5</td>\n",
       "      <td>US</td>\n",
       "      <td>Seattle</td>\n",
       "      <td>vNJS4H</td>\n",
       "      <td>WA</td>\n",
       "      <td>u0uD9q</td>\n",
       "      <td>1.319564e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>o_4us71ccioa</td>\n",
       "      <td>[47.5951, -122.332603]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/Los_Angeles</td>\n",
       "      <td>https://www.nysdot.gov/rexdesign/design/commun...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4...</td>\n",
       "      <td>en-us,en;q=0.5</td>\n",
       "      <td>US</td>\n",
       "      <td>Washington</td>\n",
       "      <td>wG7OIH</td>\n",
       "      <td>DC</td>\n",
       "      <td>A0nRz4</td>\n",
       "      <td>1.331816e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>darrellissa</td>\n",
       "      <td>[38.937599, -77.092796]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://t.co/ND7SoPyo</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://oversight.house.gov/wp-content/uploads/...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2)...</td>\n",
       "      <td>en-us,en;q=0.5</td>\n",
       "      <td>US</td>\n",
       "      <td>Alexandria</td>\n",
       "      <td>vNJS4H</td>\n",
       "      <td>VA</td>\n",
       "      <td>u0uD9q</td>\n",
       "      <td>1.319564e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>o_4us71ccioa</td>\n",
       "      <td>[38.790901, -77.094704]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>https://www.nysdot.gov/rexdesign/design/commun...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US...</td>\n",
       "      <td>en-us,en;q=0.5</td>\n",
       "      <td>US</td>\n",
       "      <td>Marietta</td>\n",
       "      <td>2rOUYc</td>\n",
       "      <td>GA</td>\n",
       "      <td>2rOUYc</td>\n",
       "      <td>1.255770e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[33.953201, -84.5177]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://toxtown.nlm.nih.gov/index.php</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1...</td>\n",
       "      <td>zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4</td>\n",
       "      <td>HK</td>\n",
       "      <td>Central District</td>\n",
       "      <td>nQvgJp</td>\n",
       "      <td>00</td>\n",
       "      <td>rtrrth</td>\n",
       "      <td>1.317318e+09</td>\n",
       "      <td>j.mp</td>\n",
       "      <td>NaN</td>\n",
       "      <td>walkeryuen</td>\n",
       "      <td>[22.2833, 114.150002]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>http://forum2.hkgolden.com/view.aspx?type=BW&amp;m...</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>Asia/Hong_Kong</td>\n",
       "      <td>http://www.ssd.noaa.gov/PS/TROP/TCFP/data/curr...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1...</td>\n",
       "      <td>zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4</td>\n",
       "      <td>HK</td>\n",
       "      <td>Central District</td>\n",
       "      <td>XdUNr</td>\n",
       "      <td>00</td>\n",
       "      <td>qWkgbq</td>\n",
       "      <td>1.317318e+09</td>\n",
       "      <td>j.mp</td>\n",
       "      <td>NaN</td>\n",
       "      <td>walkeryuen</td>\n",
       "      <td>[22.2833, 114.150002]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>http://forum2.hkgolden.com/view.aspx?type=BW&amp;m...</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>Asia/Hong_Kong</td>\n",
       "      <td>http://www.usno.navy.mil/NOOC/nmfc-ph/RSS/jtwc...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; r...</td>\n",
       "      <td>en-us,en;q=0.5</td>\n",
       "      <td>US</td>\n",
       "      <td>Buckfield</td>\n",
       "      <td>zH1BFf</td>\n",
       "      <td>ME</td>\n",
       "      <td>x3jOIv</td>\n",
       "      <td>1.331840e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>andyzieminski</td>\n",
       "      <td>[44.299702, -70.369797]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://t.co/6Cx4ROLs</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://www.usda.gov/wps/portal/usda/usdahome?c...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>NaN</td>\n",
       "      <td>GoogleMaps/RochesterNY</td>\n",
       "      <td>NaN</td>\n",
       "      <td>US</td>\n",
       "      <td>Provo</td>\n",
       "      <td>mwszkS</td>\n",
       "      <td>UT</td>\n",
       "      <td>mwszkS</td>\n",
       "      <td>1.308262e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[40.218102, -111.613297]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.AwareMap.com/</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/Denver</td>\n",
       "      <td>http://www.monroecounty.gov/etc/911/rss.php</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...</td>\n",
       "      <td>it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4</td>\n",
       "      <td>IT</td>\n",
       "      <td>Venice</td>\n",
       "      <td>wcndER</td>\n",
       "      <td>20</td>\n",
       "      <td>zkpJBR</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bnjacobs</td>\n",
       "      <td>[45.438599, 12.3267]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.facebook.com/</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>Europe/Rome</td>\n",
       "      <td>http://www.nasa.gov/mission_pages/nustar/main/...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT ...</td>\n",
       "      <td>es-ES</td>\n",
       "      <td>ES</td>\n",
       "      <td>Alcal</td>\n",
       "      <td>zQ95Hi</td>\n",
       "      <td>51</td>\n",
       "      <td>ytZYWR</td>\n",
       "      <td>1.331671e+09</td>\n",
       "      <td>bitly.com</td>\n",
       "      <td>NaN</td>\n",
       "      <td>jplnews</td>\n",
       "      <td>[37.516701, -5.9833]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.facebook.com/</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>Africa/Ceuta</td>\n",
       "      <td>http://voyager.jpl.nasa.gov/imagesvideo/uranus...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6...</td>\n",
       "      <td>en-us,en;q=0.5</td>\n",
       "      <td>US</td>\n",
       "      <td>Davidsonville</td>\n",
       "      <td>wcndER</td>\n",
       "      <td>MD</td>\n",
       "      <td>zkpJBR</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bnjacobs</td>\n",
       "      <td>[38.939201, -76.635002]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.facebook.com/</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://www.nasa.gov/mission_pages/nustar/main/...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/4.0 (compatible; MSIE 8.0; Windows NT ...</td>\n",
       "      <td>en-us</td>\n",
       "      <td>US</td>\n",
       "      <td>Hockessin</td>\n",
       "      <td>y3ZImz</td>\n",
       "      <td>DE</td>\n",
       "      <td>y3ZImz</td>\n",
       "      <td>1.331064e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[39.785, -75.682297]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://portal.hud.gov/hudportal/documents/hudd...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3)...</td>\n",
       "      <td>en-us</td>\n",
       "      <td>US</td>\n",
       "      <td>Lititz</td>\n",
       "      <td>wWiOiD</td>\n",
       "      <td>PA</td>\n",
       "      <td>wWiOiD</td>\n",
       "      <td>1.330218e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[40.174999, -76.3078]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.facebook.com/l.php?u=http%3A%2F%2F1...</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://www.tricare.mil/mybenefit/ProfileFilter...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES...</td>\n",
       "      <td>es-es,es;q=0.8,en-us;q=0.5,en;q=0.3</td>\n",
       "      <td>ES</td>\n",
       "      <td>Bilbao</td>\n",
       "      <td>wcndER</td>\n",
       "      <td>59</td>\n",
       "      <td>zkpJBR</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bnjacobs</td>\n",
       "      <td>[43.25, -2.9667]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.facebook.com/</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>Europe/Madrid</td>\n",
       "      <td>http://www.nasa.gov/mission_pages/nustar/main/...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1...</td>\n",
       "      <td>en-GB,en;q=0.8,en-US;q=0.6,en-AU;q=0.4</td>\n",
       "      <td>MY</td>\n",
       "      <td>Kuala Lumpur</td>\n",
       "      <td>wcndER</td>\n",
       "      <td>14</td>\n",
       "      <td>zkpJBR</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bnjacobs</td>\n",
       "      <td>[3.1667, 101.699997]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.facebook.com/</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>Asia/Kuala_Lumpur</td>\n",
       "      <td>http://www.nasa.gov/mission_pages/nustar/main/...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1...</td>\n",
       "      <td>ro-RO,ro;q=0.8,en-US;q=0.6,en;q=0.4</td>\n",
       "      <td>CY</td>\n",
       "      <td>Nicosia</td>\n",
       "      <td>wcndER</td>\n",
       "      <td>04</td>\n",
       "      <td>zkpJBR</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bnjacobs</td>\n",
       "      <td>[35.166698, 33.366699]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.facebook.com/?ref=tn_tnmn</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>Asia/Nicosia</td>\n",
       "      <td>http://www.nasa.gov/mission_pages/nustar/main/...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8)...</td>\n",
       "      <td>en-US,en;q=0.8</td>\n",
       "      <td>BR</td>\n",
       "      <td>SPaulo</td>\n",
       "      <td>zCaLwp</td>\n",
       "      <td>27</td>\n",
       "      <td>zUtuOu</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>alelex88</td>\n",
       "      <td>[-23.5333, -46.616699]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>America/Sao_Paulo</td>\n",
       "      <td>http://apod.nasa.gov/apod/ap120312.html</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (iPad; CPU OS 5_0_1 like Mac OS X)...</td>\n",
       "      <td>en-us</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>vNJS4H</td>\n",
       "      <td>NaN</td>\n",
       "      <td>u0uD9q</td>\n",
       "      <td>1.319564e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>o_4us71ccioa</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td></td>\n",
       "      <td>https://www.nysdot.gov/rexdesign/design/commun...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X...</td>\n",
       "      <td>en-us</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>FPX0IM</td>\n",
       "      <td>NaN</td>\n",
       "      <td>FPX0IL</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>twittershare</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>http://t.co/5xlp0B34</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td></td>\n",
       "      <td>http://www.ed.gov/news/media-advisories/us-dep...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3530</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.1...</td>\n",
       "      <td>en-US,en;q=0.8</td>\n",
       "      <td>US</td>\n",
       "      <td>San Francisco</td>\n",
       "      <td>xVZg4P</td>\n",
       "      <td>CA</td>\n",
       "      <td>wqUkTo</td>\n",
       "      <td>1.331908e+09</td>\n",
       "      <td>go.nasa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>nasatwitter</td>\n",
       "      <td>[37.7645, -122.429398]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.facebook.com/l.php?u=http%3A%2F%2Fg...</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Los_Angeles</td>\n",
       "      <td>http://www.nasa.gov/multimedia/imagegallery/im...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3531</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6...</td>\n",
       "      <td>en-US</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>wcndER</td>\n",
       "      <td>NaN</td>\n",
       "      <td>zkpJBR</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bnjacobs</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td></td>\n",
       "      <td>http://www.nasa.gov/mission_pages/nustar/main/...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3532</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2)...</td>\n",
       "      <td>en-us,en;q=0.5</td>\n",
       "      <td>US</td>\n",
       "      <td>Washington</td>\n",
       "      <td>Au3aUS</td>\n",
       "      <td>DC</td>\n",
       "      <td>A9ct6C</td>\n",
       "      <td>1.331926e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ncsha</td>\n",
       "      <td>[38.904202, -77.031998]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>http://www.ncsha.org/</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://portal.hud.gov/hudportal/HUD?src=/press...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3533</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) A...</td>\n",
       "      <td>en-us</td>\n",
       "      <td>US</td>\n",
       "      <td>Jacksonville</td>\n",
       "      <td>b2UtUJ</td>\n",
       "      <td>FL</td>\n",
       "      <td>ieCdgH</td>\n",
       "      <td>1.301393e+09</td>\n",
       "      <td>go.nasa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>nasatwitter</td>\n",
       "      <td>[30.279301, -81.585098]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://apod.nasa.gov/apod/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3534</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8)...</td>\n",
       "      <td>en-us</td>\n",
       "      <td>US</td>\n",
       "      <td>Frisco</td>\n",
       "      <td>vNJS4H</td>\n",
       "      <td>TX</td>\n",
       "      <td>u0uD9q</td>\n",
       "      <td>1.319564e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>o_4us71ccioa</td>\n",
       "      <td>[33.149899, -96.855499]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Chicago</td>\n",
       "      <td>https://www.nysdot.gov/rexdesign/design/commun...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3535</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/...</td>\n",
       "      <td>en-us</td>\n",
       "      <td>US</td>\n",
       "      <td>Houston</td>\n",
       "      <td>zIgLx8</td>\n",
       "      <td>TX</td>\n",
       "      <td>yrPaLt</td>\n",
       "      <td>1.331903e+09</td>\n",
       "      <td>aash.to</td>\n",
       "      <td>NaN</td>\n",
       "      <td>aashto</td>\n",
       "      <td>[29.775499, -95.415199]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Chicago</td>\n",
       "      <td>http://ntl.bts.gov/lib/44000/44300/44374/FHWA-...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3536</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; e...</td>\n",
       "      <td>en-US,en;q=0.5</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>xIcyim</td>\n",
       "      <td>NaN</td>\n",
       "      <td>yG1TTf</td>\n",
       "      <td>1.331728e+09</td>\n",
       "      <td>go.nasa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>nasatwitter</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://t.co/g1VKE8zS</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td></td>\n",
       "      <td>http://www.nasa.gov/mission_pages/hurricanes/a...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3537</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2)...</td>\n",
       "      <td>es-es,es;q=0.8,en-us;q=0.5,en;q=0.3</td>\n",
       "      <td>HN</td>\n",
       "      <td>Tegucigalpa</td>\n",
       "      <td>zCaLwp</td>\n",
       "      <td>08</td>\n",
       "      <td>w63FZW</td>\n",
       "      <td>1.331547e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bufferapp</td>\n",
       "      <td>[14.1, -87.216698]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://t.co/A8TJyibE</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Tegucigalpa</td>\n",
       "      <td>http://apod.nasa.gov/apod/ap120312.html</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3538</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Ma...</td>\n",
       "      <td>en-us</td>\n",
       "      <td>US</td>\n",
       "      <td>Los Angeles</td>\n",
       "      <td>qMac9k</td>\n",
       "      <td>CA</td>\n",
       "      <td>qds1Ge</td>\n",
       "      <td>1.310474e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>healthypeople</td>\n",
       "      <td>[34.041599, -118.298798]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Los_Angeles</td>\n",
       "      <td>http://healthypeople.gov/2020/connect/webinars...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3539</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (compatible; Fedora Core 3) FC3 KDE</td>\n",
       "      <td>NaN</td>\n",
       "      <td>US</td>\n",
       "      <td>Bellevue</td>\n",
       "      <td>zu2M5o</td>\n",
       "      <td>WA</td>\n",
       "      <td>zDhdro</td>\n",
       "      <td>1.331586e+09</td>\n",
       "      <td>bit.ly</td>\n",
       "      <td>NaN</td>\n",
       "      <td>glimtwin</td>\n",
       "      <td>[47.615398, -122.210297]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Los_Angeles</td>\n",
       "      <td>http://www.federalreserve.gov/newsevents/press...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3540</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...</td>\n",
       "      <td>en-US,en;q=0.8</td>\n",
       "      <td>US</td>\n",
       "      <td>Payson</td>\n",
       "      <td>wcndER</td>\n",
       "      <td>UT</td>\n",
       "      <td>zkpJBR</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bnjacobs</td>\n",
       "      <td>[40.014198, -111.738899]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.facebook.com/l.php?u=http%3A%2F%2F1...</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Denver</td>\n",
       "      <td>http://www.nasa.gov/mission_pages/nustar/main/...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3541</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (X11; U; OpenVMS AlphaServer_ES40;...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>US</td>\n",
       "      <td>Bellevue</td>\n",
       "      <td>zu2M5o</td>\n",
       "      <td>WA</td>\n",
       "      <td>zDhdro</td>\n",
       "      <td>1.331586e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>glimtwin</td>\n",
       "      <td>[47.615398, -122.210297]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Los_Angeles</td>\n",
       "      <td>http://www.federalreserve.gov/newsevents/press...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3542</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT ...</td>\n",
       "      <td>en-us</td>\n",
       "      <td>US</td>\n",
       "      <td>Pittsburg</td>\n",
       "      <td>y3reI1</td>\n",
       "      <td>CA</td>\n",
       "      <td>y3reI1</td>\n",
       "      <td>1.331926e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[38.0051, -121.838699]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.facebook.com/l.php?u=http%3A%2F%2F1...</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Los_Angeles</td>\n",
       "      <td>http://www.sba.gov/community/blogs/community-b...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3543</th>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3544</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0.1) ...</td>\n",
       "      <td>en-us,en;q=0.5</td>\n",
       "      <td>US</td>\n",
       "      <td>Wentzville</td>\n",
       "      <td>vNJS4H</td>\n",
       "      <td>MO</td>\n",
       "      <td>u0uD9q</td>\n",
       "      <td>1.319564e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>o_4us71ccioa</td>\n",
       "      <td>[38.790001, -90.854897]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Chicago</td>\n",
       "      <td>https://www.nysdot.gov/rexdesign/design/commun...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3545</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2)...</td>\n",
       "      <td>en-us,en;q=0.5</td>\n",
       "      <td>US</td>\n",
       "      <td>Saint Charles</td>\n",
       "      <td>vNJS4H</td>\n",
       "      <td>IL</td>\n",
       "      <td>u0uD9q</td>\n",
       "      <td>1.319564e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>o_4us71ccioa</td>\n",
       "      <td>[41.9352, -88.290901]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Chicago</td>\n",
       "      <td>https://www.nysdot.gov/rexdesign/design/commun...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3546</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Ma...</td>\n",
       "      <td>en-us</td>\n",
       "      <td>US</td>\n",
       "      <td>Los Angeles</td>\n",
       "      <td>qMac9k</td>\n",
       "      <td>CA</td>\n",
       "      <td>qds1Ge</td>\n",
       "      <td>1.310474e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>healthypeople</td>\n",
       "      <td>[34.041599, -118.298798]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Los_Angeles</td>\n",
       "      <td>http://healthypeople.gov/2020/connect/webinars...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3547</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8)...</td>\n",
       "      <td>en-us</td>\n",
       "      <td>US</td>\n",
       "      <td>Silver Spring</td>\n",
       "      <td>y0jYkg</td>\n",
       "      <td>MD</td>\n",
       "      <td>y0jYkg</td>\n",
       "      <td>1.331852e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[39.052101, -77.014999]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://www.epa.gov/otaq/regs/fuels/additive/e1...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3548</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Ma...</td>\n",
       "      <td>en-us</td>\n",
       "      <td>US</td>\n",
       "      <td>Mcgehee</td>\n",
       "      <td>y5rMac</td>\n",
       "      <td>AR</td>\n",
       "      <td>xANY6O</td>\n",
       "      <td>1.331916e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>twitterfeed</td>\n",
       "      <td>[33.628399, -91.356903]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>https://twitter.com/fdarecalls/status/18069759...</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Chicago</td>\n",
       "      <td>http://www.fda.gov/Safety/Recalls/ucm296326.htm</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3549</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...</td>\n",
       "      <td>sv-SE,sv;q=0.8,en-US;q=0.6,en;q=0.4</td>\n",
       "      <td>SE</td>\n",
       "      <td>Sollefte</td>\n",
       "      <td>eH8wu</td>\n",
       "      <td>24</td>\n",
       "      <td>7dtjei</td>\n",
       "      <td>1.260316e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>tweetdeckapi</td>\n",
       "      <td>[63.166698, 17.266701]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>Europe/Stockholm</td>\n",
       "      <td>http://www.nasa.gov/mission_pages/WISE/main/in...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3550</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/4.0 (compatible; MSIE 8.0; Windows NT ...</td>\n",
       "      <td>en-us</td>\n",
       "      <td>US</td>\n",
       "      <td>Conshohocken</td>\n",
       "      <td>A00b72</td>\n",
       "      <td>PA</td>\n",
       "      <td>yGSwzn</td>\n",
       "      <td>1.331918e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>addthis</td>\n",
       "      <td>[40.0798, -75.2855]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.linkedin.com/home?trk=hb_tab_home_top</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://www.nlm.nih.gov/medlineplus/news/fullst...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3551</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...</td>\n",
       "      <td>en-US,en;q=0.8</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>wcndER</td>\n",
       "      <td>NaN</td>\n",
       "      <td>zkpJBR</td>\n",
       "      <td>1.331923e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bnjacobs</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://plus.url.google.com/url?sa=z&amp;n=13319268...</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td></td>\n",
       "      <td>http://www.nasa.gov/mission_pages/nustar/main/...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3552</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>US</td>\n",
       "      <td>Decatur</td>\n",
       "      <td>rqgJuE</td>\n",
       "      <td>AL</td>\n",
       "      <td>xcz8vt</td>\n",
       "      <td>1.331227e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bootsnall</td>\n",
       "      <td>[34.572701, -86.940598]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Chicago</td>\n",
       "      <td>http://travel.state.gov/passport/passport_5535...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3553</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/4.0 (compatible; MSIE 7.0; Windows NT ...</td>\n",
       "      <td>en-us</td>\n",
       "      <td>US</td>\n",
       "      <td>Shrewsbury</td>\n",
       "      <td>9b6kNl</td>\n",
       "      <td>MA</td>\n",
       "      <td>9b6kNl</td>\n",
       "      <td>1.273672e+09</td>\n",
       "      <td>bit.ly</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[42.286499, -71.714699]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.shrewsbury-ma.gov/selco/</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://www.shrewsbury-ma.gov/egov/gallery/1341...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3554</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/4.0 (compatible; MSIE 7.0; Windows NT ...</td>\n",
       "      <td>en-us</td>\n",
       "      <td>US</td>\n",
       "      <td>Shrewsbury</td>\n",
       "      <td>axNK8c</td>\n",
       "      <td>MA</td>\n",
       "      <td>axNK8c</td>\n",
       "      <td>1.273673e+09</td>\n",
       "      <td>bit.ly</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[42.286499, -71.714699]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.shrewsbury-ma.gov/selco/</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://www.shrewsbury-ma.gov/egov/gallery/1341...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3555</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/4.0 (compatible; MSIE 9.0; Windows NT ...</td>\n",
       "      <td>en</td>\n",
       "      <td>US</td>\n",
       "      <td>Paramus</td>\n",
       "      <td>e5SvKE</td>\n",
       "      <td>NJ</td>\n",
       "      <td>fqPSr9</td>\n",
       "      <td>1.301298e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>tweetdeckapi</td>\n",
       "      <td>[40.9445, -74.07]</td>\n",
       "      <td>1.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://www.fda.gov/AdvisoryCommittees/Committe...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3556</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1...</td>\n",
       "      <td>en-US,en;q=0.8</td>\n",
       "      <td>US</td>\n",
       "      <td>Oklahoma City</td>\n",
       "      <td>jQLtP4</td>\n",
       "      <td>OK</td>\n",
       "      <td>jQLtP4</td>\n",
       "      <td>1.307530e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[35.4715, -97.518997]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.facebook.com/l.php?u=http%3A%2F%2F1...</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Chicago</td>\n",
       "      <td>http://www.okc.gov/PublicNotificationSystem/Fo...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3557</th>\n",
       "      <td>NaN</td>\n",
       "      <td>GoogleMaps/RochesterNY</td>\n",
       "      <td>NaN</td>\n",
       "      <td>US</td>\n",
       "      <td>Provo</td>\n",
       "      <td>mwszkS</td>\n",
       "      <td>UT</td>\n",
       "      <td>mwszkS</td>\n",
       "      <td>1.308262e+09</td>\n",
       "      <td>j.mp</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[40.218102, -111.613297]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://www.AwareMap.com/</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Denver</td>\n",
       "      <td>http://www.monroecounty.gov/etc/911/rss.php</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3558</th>\n",
       "      <td>NaN</td>\n",
       "      <td>GoogleProducer</td>\n",
       "      <td>NaN</td>\n",
       "      <td>US</td>\n",
       "      <td>Mountain View</td>\n",
       "      <td>zjtI4X</td>\n",
       "      <td>CA</td>\n",
       "      <td>zjtI4X</td>\n",
       "      <td>1.327529e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[37.419201, -122.057404]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>direct</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/Los_Angeles</td>\n",
       "      <td>http://www.ahrq.gov/qual/qitoolkit/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3559</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Mozilla/4.0 (compatible; MSIE 8.0; Windows NT ...</td>\n",
       "      <td>en-US</td>\n",
       "      <td>US</td>\n",
       "      <td>Mc Lean</td>\n",
       "      <td>qxKrTK</td>\n",
       "      <td>VA</td>\n",
       "      <td>qxKrTK</td>\n",
       "      <td>1.312898e+09</td>\n",
       "      <td>1.usa.gov</td>\n",
       "      <td>NaN</td>\n",
       "      <td>bitly</td>\n",
       "      <td>[38.935799, -77.162102]</td>\n",
       "      <td>0.0</td>\n",
       "      <td>http://t.co/OEEEvwjU</td>\n",
       "      <td>1.331927e+09</td>\n",
       "      <td>America/New_York</td>\n",
       "      <td>http://herndon-va.gov/Content/public_safety/Pu...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>3560 rows × 18 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       _heartbeat_                                                  a  \\\n",
       "0              NaN  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...   \n",
       "1              NaN                             GoogleMaps/RochesterNY   \n",
       "2              NaN  Mozilla/4.0 (compatible; MSIE 8.0; Windows NT ...   \n",
       "3              NaN  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8)...   \n",
       "4              NaN  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...   \n",
       "5              NaN  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...   \n",
       "6              NaN  Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1...   \n",
       "7              NaN  Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/2...   \n",
       "8              NaN  Opera/9.80 (X11; Linux zbov; U; en) Presto/2.1...   \n",
       "9              NaN  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...   \n",
       "10             NaN  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2)...   \n",
       "11             NaN  Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4...   \n",
       "12             NaN  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2)...   \n",
       "13    1.331923e+09                                                NaN   \n",
       "14             NaN  Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US...   \n",
       "15             NaN  Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1...   \n",
       "16             NaN  Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1...   \n",
       "17             NaN  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; r...   \n",
       "18             NaN                             GoogleMaps/RochesterNY   \n",
       "19             NaN  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...   \n",
       "20             NaN  Mozilla/5.0 (compatible; MSIE 9.0; Windows NT ...   \n",
       "21             NaN  Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6...   \n",
       "22             NaN  Mozilla/4.0 (compatible; MSIE 8.0; Windows NT ...   \n",
       "23             NaN  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3)...   \n",
       "24             NaN  Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES...   \n",
       "25             NaN  Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1...   \n",
       "26             NaN  Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1...   \n",
       "27             NaN  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8)...   \n",
       "28             NaN  Mozilla/5.0 (iPad; CPU OS 5_0_1 like Mac OS X)...   \n",
       "29             NaN  Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X...   \n",
       "...            ...                                                ...   \n",
       "3530           NaN  Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.1...   \n",
       "3531           NaN  Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6...   \n",
       "3532           NaN  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2)...   \n",
       "3533           NaN  Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) A...   \n",
       "3534           NaN  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8)...   \n",
       "3535           NaN  Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/...   \n",
       "3536           NaN  Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; e...   \n",
       "3537           NaN  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2)...   \n",
       "3538           NaN  Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Ma...   \n",
       "3539           NaN    Mozilla/5.0 (compatible; Fedora Core 3) FC3 KDE   \n",
       "3540           NaN  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...   \n",
       "3541           NaN  Mozilla/5.0 (X11; U; OpenVMS AlphaServer_ES40;...   \n",
       "3542           NaN  Mozilla/5.0 (compatible; MSIE 9.0; Windows NT ...   \n",
       "3543  1.331927e+09                                                NaN   \n",
       "3544           NaN  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0.1) ...   \n",
       "3545           NaN  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2)...   \n",
       "3546           NaN  Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Ma...   \n",
       "3547           NaN  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8)...   \n",
       "3548           NaN  Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Ma...   \n",
       "3549           NaN  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...   \n",
       "3550           NaN  Mozilla/4.0 (compatible; MSIE 8.0; Windows NT ...   \n",
       "3551           NaN  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKi...   \n",
       "3552           NaN  Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US...   \n",
       "3553           NaN  Mozilla/4.0 (compatible; MSIE 7.0; Windows NT ...   \n",
       "3554           NaN  Mozilla/4.0 (compatible; MSIE 7.0; Windows NT ...   \n",
       "3555           NaN  Mozilla/4.0 (compatible; MSIE 9.0; Windows NT ...   \n",
       "3556           NaN  Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1...   \n",
       "3557           NaN                             GoogleMaps/RochesterNY   \n",
       "3558           NaN                                     GoogleProducer   \n",
       "3559           NaN  Mozilla/4.0 (compatible; MSIE 8.0; Windows NT ...   \n",
       "\n",
       "                                          al     c                cy       g  \\\n",
       "0                             en-US,en;q=0.8    US           Danvers  A6qOVH   \n",
       "1                                        NaN    US             Provo  mwszkS   \n",
       "2                                      en-US    US        Washington  xxr3Qb   \n",
       "3                                      pt-br    BR              Braz  zCaLwp   \n",
       "4                             en-US,en;q=0.8    US        Shrewsbury  9b6kNl   \n",
       "5                             en-US,en;q=0.8    US        Shrewsbury  axNK8c   \n",
       "6        pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4    PL             Luban  wcndER   \n",
       "7                    bg,en-us;q=0.7,en;q=0.3  None               NaN  wcndER   \n",
       "8                                  en-US, en  None               NaN  wcndER   \n",
       "9        pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4  None               NaN  zCaLwp   \n",
       "10                            en-us,en;q=0.5    US           Seattle  vNJS4H   \n",
       "11                            en-us,en;q=0.5    US        Washington  wG7OIH   \n",
       "12                            en-us,en;q=0.5    US        Alexandria  vNJS4H   \n",
       "13                                       NaN   NaN               NaN     NaN   \n",
       "14                            en-us,en;q=0.5    US          Marietta  2rOUYc   \n",
       "15       zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4    HK  Central District  nQvgJp   \n",
       "16       zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4    HK  Central District   XdUNr   \n",
       "17                            en-us,en;q=0.5    US         Buckfield  zH1BFf   \n",
       "18                                       NaN    US             Provo  mwszkS   \n",
       "19       it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4    IT            Venice  wcndER   \n",
       "20                                     es-ES    ES             Alcal  zQ95Hi   \n",
       "21                            en-us,en;q=0.5    US     Davidsonville  wcndER   \n",
       "22                                     en-us    US         Hockessin  y3ZImz   \n",
       "23                                     en-us    US            Lititz  wWiOiD   \n",
       "24       es-es,es;q=0.8,en-us;q=0.5,en;q=0.3    ES            Bilbao  wcndER   \n",
       "25    en-GB,en;q=0.8,en-US;q=0.6,en-AU;q=0.4    MY      Kuala Lumpur  wcndER   \n",
       "26       ro-RO,ro;q=0.8,en-US;q=0.6,en;q=0.4    CY           Nicosia  wcndER   \n",
       "27                            en-US,en;q=0.8    BR            SPaulo  zCaLwp   \n",
       "28                                     en-us  None               NaN  vNJS4H   \n",
       "29                                     en-us  None               NaN  FPX0IM   \n",
       "...                                      ...   ...               ...     ...   \n",
       "3530                          en-US,en;q=0.8    US     San Francisco  xVZg4P   \n",
       "3531                                   en-US  None               NaN  wcndER   \n",
       "3532                          en-us,en;q=0.5    US        Washington  Au3aUS   \n",
       "3533                                   en-us    US      Jacksonville  b2UtUJ   \n",
       "3534                                   en-us    US            Frisco  vNJS4H   \n",
       "3535                                   en-us    US           Houston  zIgLx8   \n",
       "3536                          en-US,en;q=0.5  None               NaN  xIcyim   \n",
       "3537     es-es,es;q=0.8,en-us;q=0.5,en;q=0.3    HN       Tegucigalpa  zCaLwp   \n",
       "3538                                   en-us    US       Los Angeles  qMac9k   \n",
       "3539                                     NaN    US          Bellevue  zu2M5o   \n",
       "3540                          en-US,en;q=0.8    US            Payson  wcndER   \n",
       "3541                                     NaN    US          Bellevue  zu2M5o   \n",
       "3542                                   en-us    US         Pittsburg  y3reI1   \n",
       "3543                                     NaN   NaN               NaN     NaN   \n",
       "3544                          en-us,en;q=0.5    US        Wentzville  vNJS4H   \n",
       "3545                          en-us,en;q=0.5    US     Saint Charles  vNJS4H   \n",
       "3546                                   en-us    US       Los Angeles  qMac9k   \n",
       "3547                                   en-us    US     Silver Spring  y0jYkg   \n",
       "3548                                   en-us    US           Mcgehee  y5rMac   \n",
       "3549     sv-SE,sv;q=0.8,en-US;q=0.6,en;q=0.4    SE          Sollefte   eH8wu   \n",
       "3550                                   en-us    US      Conshohocken  A00b72   \n",
       "3551                          en-US,en;q=0.8  None               NaN  wcndER   \n",
       "3552                                     NaN    US           Decatur  rqgJuE   \n",
       "3553                                   en-us    US        Shrewsbury  9b6kNl   \n",
       "3554                                   en-us    US        Shrewsbury  axNK8c   \n",
       "3555                                      en    US           Paramus  e5SvKE   \n",
       "3556                          en-US,en;q=0.8    US     Oklahoma City  jQLtP4   \n",
       "3557                                     NaN    US             Provo  mwszkS   \n",
       "3558                                     NaN    US     Mountain View  zjtI4X   \n",
       "3559                                   en-US    US           Mc Lean  qxKrTK   \n",
       "\n",
       "       gr       h            hc           hh   kw              l  \\\n",
       "0      MA  wfLQtf  1.331823e+09    1.usa.gov  NaN        orofrog   \n",
       "1      UT  mwszkS  1.308262e+09         j.mp  NaN          bitly   \n",
       "2      DC  xxr3Qb  1.331920e+09    1.usa.gov  NaN          bitly   \n",
       "3      27  zUtuOu  1.331923e+09    1.usa.gov  NaN       alelex88   \n",
       "4      MA  9b6kNl  1.273672e+09       bit.ly  NaN          bitly   \n",
       "5      MA  axNK8c  1.273673e+09       bit.ly  NaN          bitly   \n",
       "6      77  zkpJBR  1.331923e+09    1.usa.gov  NaN       bnjacobs   \n",
       "7     NaN  zkpJBR  1.331923e+09    1.usa.gov  NaN       bnjacobs   \n",
       "8     NaN  zkpJBR  1.331923e+09    1.usa.gov  NaN       bnjacobs   \n",
       "9     NaN  zUtuOu  1.331923e+09    1.usa.gov  NaN       alelex88   \n",
       "10     WA  u0uD9q  1.319564e+09    1.usa.gov  NaN   o_4us71ccioa   \n",
       "11     DC  A0nRz4  1.331816e+09    1.usa.gov  NaN    darrellissa   \n",
       "12     VA  u0uD9q  1.319564e+09    1.usa.gov  NaN   o_4us71ccioa   \n",
       "13    NaN     NaN           NaN          NaN  NaN            NaN   \n",
       "14     GA  2rOUYc  1.255770e+09    1.usa.gov  NaN          bitly   \n",
       "15     00  rtrrth  1.317318e+09         j.mp  NaN     walkeryuen   \n",
       "16     00  qWkgbq  1.317318e+09         j.mp  NaN     walkeryuen   \n",
       "17     ME  x3jOIv  1.331840e+09    1.usa.gov  NaN  andyzieminski   \n",
       "18     UT  mwszkS  1.308262e+09    1.usa.gov  NaN          bitly   \n",
       "19     20  zkpJBR  1.331923e+09    1.usa.gov  NaN       bnjacobs   \n",
       "20     51  ytZYWR  1.331671e+09    bitly.com  NaN        jplnews   \n",
       "21     MD  zkpJBR  1.331923e+09    1.usa.gov  NaN       bnjacobs   \n",
       "22     DE  y3ZImz  1.331064e+09    1.usa.gov  NaN          bitly   \n",
       "23     PA  wWiOiD  1.330218e+09    1.usa.gov  NaN          bitly   \n",
       "24     59  zkpJBR  1.331923e+09    1.usa.gov  NaN       bnjacobs   \n",
       "25     14  zkpJBR  1.331923e+09    1.usa.gov  NaN       bnjacobs   \n",
       "26     04  zkpJBR  1.331923e+09    1.usa.gov  NaN       bnjacobs   \n",
       "27     27  zUtuOu  1.331923e+09    1.usa.gov  NaN       alelex88   \n",
       "28    NaN  u0uD9q  1.319564e+09    1.usa.gov  NaN   o_4us71ccioa   \n",
       "29    NaN  FPX0IL  1.331923e+09    1.usa.gov  NaN   twittershare   \n",
       "...   ...     ...           ...          ...  ...            ...   \n",
       "3530   CA  wqUkTo  1.331908e+09  go.nasa.gov  NaN    nasatwitter   \n",
       "3531  NaN  zkpJBR  1.331923e+09    1.usa.gov  NaN       bnjacobs   \n",
       "3532   DC  A9ct6C  1.331926e+09    1.usa.gov  NaN          ncsha   \n",
       "3533   FL  ieCdgH  1.301393e+09  go.nasa.gov  NaN    nasatwitter   \n",
       "3534   TX  u0uD9q  1.319564e+09    1.usa.gov  NaN   o_4us71ccioa   \n",
       "3535   TX  yrPaLt  1.331903e+09      aash.to  NaN         aashto   \n",
       "3536  NaN  yG1TTf  1.331728e+09  go.nasa.gov  NaN    nasatwitter   \n",
       "3537   08  w63FZW  1.331547e+09    1.usa.gov  NaN      bufferapp   \n",
       "3538   CA  qds1Ge  1.310474e+09    1.usa.gov  NaN  healthypeople   \n",
       "3539   WA  zDhdro  1.331586e+09       bit.ly  NaN       glimtwin   \n",
       "3540   UT  zkpJBR  1.331923e+09    1.usa.gov  NaN       bnjacobs   \n",
       "3541   WA  zDhdro  1.331586e+09    1.usa.gov  NaN       glimtwin   \n",
       "3542   CA  y3reI1  1.331926e+09    1.usa.gov  NaN          bitly   \n",
       "3543  NaN     NaN           NaN          NaN  NaN            NaN   \n",
       "3544   MO  u0uD9q  1.319564e+09    1.usa.gov  NaN   o_4us71ccioa   \n",
       "3545   IL  u0uD9q  1.319564e+09    1.usa.gov  NaN   o_4us71ccioa   \n",
       "3546   CA  qds1Ge  1.310474e+09    1.usa.gov  NaN  healthypeople   \n",
       "3547   MD  y0jYkg  1.331852e+09    1.usa.gov  NaN          bitly   \n",
       "3548   AR  xANY6O  1.331916e+09    1.usa.gov  NaN    twitterfeed   \n",
       "3549   24  7dtjei  1.260316e+09    1.usa.gov  NaN   tweetdeckapi   \n",
       "3550   PA  yGSwzn  1.331918e+09    1.usa.gov  NaN        addthis   \n",
       "3551  NaN  zkpJBR  1.331923e+09    1.usa.gov  NaN       bnjacobs   \n",
       "3552   AL  xcz8vt  1.331227e+09    1.usa.gov  NaN      bootsnall   \n",
       "3553   MA  9b6kNl  1.273672e+09       bit.ly  NaN          bitly   \n",
       "3554   MA  axNK8c  1.273673e+09       bit.ly  NaN          bitly   \n",
       "3555   NJ  fqPSr9  1.301298e+09    1.usa.gov  NaN   tweetdeckapi   \n",
       "3556   OK  jQLtP4  1.307530e+09    1.usa.gov  NaN          bitly   \n",
       "3557   UT  mwszkS  1.308262e+09         j.mp  NaN          bitly   \n",
       "3558   CA  zjtI4X  1.327529e+09    1.usa.gov  NaN          bitly   \n",
       "3559   VA  qxKrTK  1.312898e+09    1.usa.gov  NaN          bitly   \n",
       "\n",
       "                            ll   nk  \\\n",
       "0      [42.576698, -70.954903]  1.0   \n",
       "1     [40.218102, -111.613297]  0.0   \n",
       "2        [38.9007, -77.043098]  1.0   \n",
       "3     [-23.549999, -46.616699]  0.0   \n",
       "4      [42.286499, -71.714699]  0.0   \n",
       "5      [42.286499, -71.714699]  0.0   \n",
       "6         [51.116699, 15.2833]  0.0   \n",
       "7                          NaN  0.0   \n",
       "8                          NaN  0.0   \n",
       "9                          NaN  0.0   \n",
       "10      [47.5951, -122.332603]  1.0   \n",
       "11     [38.937599, -77.092796]  0.0   \n",
       "12     [38.790901, -77.094704]  1.0   \n",
       "13                         NaN  NaN   \n",
       "14       [33.953201, -84.5177]  1.0   \n",
       "15       [22.2833, 114.150002]  1.0   \n",
       "16       [22.2833, 114.150002]  1.0   \n",
       "17     [44.299702, -70.369797]  0.0   \n",
       "18    [40.218102, -111.613297]  0.0   \n",
       "19        [45.438599, 12.3267]  0.0   \n",
       "20        [37.516701, -5.9833]  0.0   \n",
       "21     [38.939201, -76.635002]  0.0   \n",
       "22        [39.785, -75.682297]  0.0   \n",
       "23       [40.174999, -76.3078]  0.0   \n",
       "24            [43.25, -2.9667]  0.0   \n",
       "25        [3.1667, 101.699997]  0.0   \n",
       "26      [35.166698, 33.366699]  0.0   \n",
       "27      [-23.5333, -46.616699]  0.0   \n",
       "28                         NaN  0.0   \n",
       "29                         NaN  1.0   \n",
       "...                        ...  ...   \n",
       "3530    [37.7645, -122.429398]  0.0   \n",
       "3531                       NaN  0.0   \n",
       "3532   [38.904202, -77.031998]  1.0   \n",
       "3533   [30.279301, -81.585098]  1.0   \n",
       "3534   [33.149899, -96.855499]  1.0   \n",
       "3535   [29.775499, -95.415199]  1.0   \n",
       "3536                       NaN  0.0   \n",
       "3537        [14.1, -87.216698]  0.0   \n",
       "3538  [34.041599, -118.298798]  0.0   \n",
       "3539  [47.615398, -122.210297]  0.0   \n",
       "3540  [40.014198, -111.738899]  0.0   \n",
       "3541  [47.615398, -122.210297]  0.0   \n",
       "3542    [38.0051, -121.838699]  0.0   \n",
       "3543                       NaN  NaN   \n",
       "3544   [38.790001, -90.854897]  1.0   \n",
       "3545     [41.9352, -88.290901]  1.0   \n",
       "3546  [34.041599, -118.298798]  1.0   \n",
       "3547   [39.052101, -77.014999]  1.0   \n",
       "3548   [33.628399, -91.356903]  1.0   \n",
       "3549    [63.166698, 17.266701]  1.0   \n",
       "3550       [40.0798, -75.2855]  0.0   \n",
       "3551                       NaN  0.0   \n",
       "3552   [34.572701, -86.940598]  0.0   \n",
       "3553   [42.286499, -71.714699]  0.0   \n",
       "3554   [42.286499, -71.714699]  0.0   \n",
       "3555         [40.9445, -74.07]  1.0   \n",
       "3556     [35.4715, -97.518997]  0.0   \n",
       "3557  [40.218102, -111.613297]  0.0   \n",
       "3558  [37.419201, -122.057404]  0.0   \n",
       "3559   [38.935799, -77.162102]  0.0   \n",
       "\n",
       "                                                      r             t  \\\n",
       "0     http://www.facebook.com/l/7AQEFzjSi/1.usa.gov/...  1.331923e+09   \n",
       "1                              http://www.AwareMap.com/  1.331923e+09   \n",
       "2                                  http://t.co/03elZC4Q  1.331923e+09   \n",
       "3                                                direct  1.331923e+09   \n",
       "4                   http://www.shrewsbury-ma.gov/selco/  1.331923e+09   \n",
       "5                   http://www.shrewsbury-ma.gov/selco/  1.331923e+09   \n",
       "6     http://plus.url.google.com/url?sa=z&n=13319232...  1.331923e+09   \n",
       "7                              http://www.facebook.com/  1.331923e+09   \n",
       "8     http://www.facebook.com/l.php?u=http%3A%2F%2F1...  1.331923e+09   \n",
       "9                                  http://t.co/o1Pd0WeV  1.331923e+09   \n",
       "10                                               direct  1.331923e+09   \n",
       "11                                 http://t.co/ND7SoPyo  1.331923e+09   \n",
       "12                                               direct  1.331923e+09   \n",
       "13                                                  NaN           NaN   \n",
       "14                                               direct  1.331923e+09   \n",
       "15    http://forum2.hkgolden.com/view.aspx?type=BW&m...  1.331923e+09   \n",
       "16    http://forum2.hkgolden.com/view.aspx?type=BW&m...  1.331923e+09   \n",
       "17                                 http://t.co/6Cx4ROLs  1.331923e+09   \n",
       "18                             http://www.AwareMap.com/  1.331923e+09   \n",
       "19                             http://www.facebook.com/  1.331923e+09   \n",
       "20                             http://www.facebook.com/  1.331923e+09   \n",
       "21                             http://www.facebook.com/  1.331923e+09   \n",
       "22                                               direct  1.331923e+09   \n",
       "23    http://www.facebook.com/l.php?u=http%3A%2F%2F1...  1.331923e+09   \n",
       "24                             http://www.facebook.com/  1.331923e+09   \n",
       "25                             http://www.facebook.com/  1.331923e+09   \n",
       "26                 http://www.facebook.com/?ref=tn_tnmn  1.331923e+09   \n",
       "27                                               direct  1.331923e+09   \n",
       "28                                               direct  1.331923e+09   \n",
       "29                                 http://t.co/5xlp0B34  1.331923e+09   \n",
       "...                                                 ...           ...   \n",
       "3530  http://www.facebook.com/l.php?u=http%3A%2F%2Fg...  1.331927e+09   \n",
       "3531                                             direct  1.331927e+09   \n",
       "3532                              http://www.ncsha.org/  1.331927e+09   \n",
       "3533                                             direct  1.331927e+09   \n",
       "3534                                             direct  1.331927e+09   \n",
       "3535                                             direct  1.331927e+09   \n",
       "3536                               http://t.co/g1VKE8zS  1.331927e+09   \n",
       "3537                               http://t.co/A8TJyibE  1.331927e+09   \n",
       "3538                                             direct  1.331927e+09   \n",
       "3539                                             direct  1.331927e+09   \n",
       "3540  http://www.facebook.com/l.php?u=http%3A%2F%2F1...  1.331927e+09   \n",
       "3541                                             direct  1.331927e+09   \n",
       "3542  http://www.facebook.com/l.php?u=http%3A%2F%2F1...  1.331927e+09   \n",
       "3543                                                NaN           NaN   \n",
       "3544                                             direct  1.331927e+09   \n",
       "3545                                             direct  1.331927e+09   \n",
       "3546                                             direct  1.331927e+09   \n",
       "3547                                             direct  1.331927e+09   \n",
       "3548  https://twitter.com/fdarecalls/status/18069759...  1.331927e+09   \n",
       "3549                                             direct  1.331927e+09   \n",
       "3550   http://www.linkedin.com/home?trk=hb_tab_home_top  1.331927e+09   \n",
       "3551  http://plus.url.google.com/url?sa=z&n=13319268...  1.331927e+09   \n",
       "3552                                             direct  1.331927e+09   \n",
       "3553                http://www.shrewsbury-ma.gov/selco/  1.331927e+09   \n",
       "3554                http://www.shrewsbury-ma.gov/selco/  1.331927e+09   \n",
       "3555                                             direct  1.331927e+09   \n",
       "3556  http://www.facebook.com/l.php?u=http%3A%2F%2F1...  1.331927e+09   \n",
       "3557                           http://www.AwareMap.com/  1.331927e+09   \n",
       "3558                                             direct  1.331927e+09   \n",
       "3559                               http://t.co/OEEEvwjU  1.331927e+09   \n",
       "\n",
       "                       tz                                                  u  \n",
       "0        America/New_York        http://www.ncbi.nlm.nih.gov/pubmed/22415991  \n",
       "1          America/Denver        http://www.monroecounty.gov/etc/911/rss.php  \n",
       "2        America/New_York  http://boxer.senate.gov/en/press/releases/0316...  \n",
       "3       America/Sao_Paulo            http://apod.nasa.gov/apod/ap120312.html  \n",
       "4        America/New_York  http://www.shrewsbury-ma.gov/egov/gallery/1341...  \n",
       "5        America/New_York  http://www.shrewsbury-ma.gov/egov/gallery/1341...  \n",
       "6           Europe/Warsaw  http://www.nasa.gov/mission_pages/nustar/main/...  \n",
       "7                          http://www.nasa.gov/mission_pages/nustar/main/...  \n",
       "8                          http://www.nasa.gov/mission_pages/nustar/main/...  \n",
       "9                                    http://apod.nasa.gov/apod/ap120312.html  \n",
       "10    America/Los_Angeles  https://www.nysdot.gov/rexdesign/design/commun...  \n",
       "11       America/New_York  http://oversight.house.gov/wp-content/uploads/...  \n",
       "12       America/New_York  https://www.nysdot.gov/rexdesign/design/commun...  \n",
       "13                    NaN                                                NaN  \n",
       "14       America/New_York               http://toxtown.nlm.nih.gov/index.php  \n",
       "15         Asia/Hong_Kong  http://www.ssd.noaa.gov/PS/TROP/TCFP/data/curr...  \n",
       "16         Asia/Hong_Kong  http://www.usno.navy.mil/NOOC/nmfc-ph/RSS/jtwc...  \n",
       "17       America/New_York  http://www.usda.gov/wps/portal/usda/usdahome?c...  \n",
       "18         America/Denver        http://www.monroecounty.gov/etc/911/rss.php  \n",
       "19            Europe/Rome  http://www.nasa.gov/mission_pages/nustar/main/...  \n",
       "20           Africa/Ceuta  http://voyager.jpl.nasa.gov/imagesvideo/uranus...  \n",
       "21       America/New_York  http://www.nasa.gov/mission_pages/nustar/main/...  \n",
       "22       America/New_York  http://portal.hud.gov/hudportal/documents/hudd...  \n",
       "23       America/New_York  http://www.tricare.mil/mybenefit/ProfileFilter...  \n",
       "24          Europe/Madrid  http://www.nasa.gov/mission_pages/nustar/main/...  \n",
       "25      Asia/Kuala_Lumpur  http://www.nasa.gov/mission_pages/nustar/main/...  \n",
       "26           Asia/Nicosia  http://www.nasa.gov/mission_pages/nustar/main/...  \n",
       "27      America/Sao_Paulo            http://apod.nasa.gov/apod/ap120312.html  \n",
       "28                         https://www.nysdot.gov/rexdesign/design/commun...  \n",
       "29                         http://www.ed.gov/news/media-advisories/us-dep...  \n",
       "...                   ...                                                ...  \n",
       "3530  America/Los_Angeles  http://www.nasa.gov/multimedia/imagegallery/im...  \n",
       "3531                       http://www.nasa.gov/mission_pages/nustar/main/...  \n",
       "3532     America/New_York  http://portal.hud.gov/hudportal/HUD?src=/press...  \n",
       "3533     America/New_York                         http://apod.nasa.gov/apod/  \n",
       "3534      America/Chicago  https://www.nysdot.gov/rexdesign/design/commun...  \n",
       "3535      America/Chicago  http://ntl.bts.gov/lib/44000/44300/44374/FHWA-...  \n",
       "3536                       http://www.nasa.gov/mission_pages/hurricanes/a...  \n",
       "3537  America/Tegucigalpa            http://apod.nasa.gov/apod/ap120312.html  \n",
       "3538  America/Los_Angeles  http://healthypeople.gov/2020/connect/webinars...  \n",
       "3539  America/Los_Angeles  http://www.federalreserve.gov/newsevents/press...  \n",
       "3540       America/Denver  http://www.nasa.gov/mission_pages/nustar/main/...  \n",
       "3541  America/Los_Angeles  http://www.federalreserve.gov/newsevents/press...  \n",
       "3542  America/Los_Angeles  http://www.sba.gov/community/blogs/community-b...  \n",
       "3543                  NaN                                                NaN  \n",
       "3544      America/Chicago  https://www.nysdot.gov/rexdesign/design/commun...  \n",
       "3545      America/Chicago  https://www.nysdot.gov/rexdesign/design/commun...  \n",
       "3546  America/Los_Angeles  http://healthypeople.gov/2020/connect/webinars...  \n",
       "3547     America/New_York  http://www.epa.gov/otaq/regs/fuels/additive/e1...  \n",
       "3548      America/Chicago    http://www.fda.gov/Safety/Recalls/ucm296326.htm  \n",
       "3549     Europe/Stockholm  http://www.nasa.gov/mission_pages/WISE/main/in...  \n",
       "3550     America/New_York  http://www.nlm.nih.gov/medlineplus/news/fullst...  \n",
       "3551                       http://www.nasa.gov/mission_pages/nustar/main/...  \n",
       "3552      America/Chicago  http://travel.state.gov/passport/passport_5535...  \n",
       "3553     America/New_York  http://www.shrewsbury-ma.gov/egov/gallery/1341...  \n",
       "3554     America/New_York  http://www.shrewsbury-ma.gov/egov/gallery/1341...  \n",
       "3555     America/New_York  http://www.fda.gov/AdvisoryCommittees/Committe...  \n",
       "3556      America/Chicago  http://www.okc.gov/PublicNotificationSystem/Fo...  \n",
       "3557       America/Denver        http://www.monroecounty.gov/etc/911/rss.php  \n",
       "3558  America/Los_Angeles                http://www.ahrq.gov/qual/qitoolkit/  \n",
       "3559     America/New_York  http://herndon-va.gov/Content/public_safety/Pu...  \n",
       "\n",
       "[3560 rows x 18 columns]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pandas import DataFrame, Series\n",
    "import pandas as pd\n",
    "\n",
    "frame = DataFrame(records)\n",
    "frame"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     America/New_York\n",
       "1       America/Denver\n",
       "2     America/New_York\n",
       "3    America/Sao_Paulo\n",
       "4     America/New_York\n",
       "5     America/New_York\n",
       "6        Europe/Warsaw\n",
       "7                     \n",
       "8                     \n",
       "9                     \n",
       "Name: tz, dtype: object"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "frame['tz'][:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "America/New_York       1251\n",
       "                        521\n",
       "America/Chicago         400\n",
       "America/Los_Angeles     382\n",
       "America/Denver          191\n",
       "Europe/London            74\n",
       "Asia/Tokyo               37\n",
       "Pacific/Honolulu         36\n",
       "Europe/Madrid            35\n",
       "America/Sao_Paulo        33\n",
       "Name: tz, dtype: int64"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tz_counts = frame['tz'].value_counts()\n",
    "tz_counts[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "America/New_York       1251\n",
       "Unknown                 521\n",
       "America/Chicago         400\n",
       "America/Los_Angeles     382\n",
       "America/Denver          191\n",
       "Missing                 120\n",
       "Europe/London            74\n",
       "Asia/Tokyo               37\n",
       "Pacific/Honolulu         36\n",
       "Europe/Madrid            35\n",
       "Name: tz, dtype: int64"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clean_tz = frame['tz'].fillna('Missing')\n",
    "clean_tz[clean_tz == ''] = 'Unknown'\n",
    "tz_counts = clean_tz.value_counts()\n",
    "tz_counts[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8cf9b00>"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8cf9b00>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(10, 4))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x8cd88d0>"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAArEAAAFpCAYAAACLX3DyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3Xm4nVV99//3x6QaLIJMUlQkqCCzgAG1gDIL6iNYKBhxwGrz4IOibX0qFFtDL/srrbYqFYeIMtgqDjjwoGIoKogDkEBImFVARWkFwahIUcL398deR7aHMyU5YZ/7nPfrus517r3uda/13Tcb/Lj22vukqpAkSZK65FGDLkCSJElaXYZYSZIkdY4hVpIkSZ1jiJUkSVLnGGIlSZLUOYZYSZIkdY4hVpIkSZ1jiJUkSVLnGGIlSZLUOYZYSZIkdc7sQRegdW/TTTetuXPnDroMSZKkcS1duvSuqtpsvH6G2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W303sLan97K7OPb27bw+/ftd/e0nd+Qh789OdPdDtxeVZe3x5+hF2p9na65A4Fbq+rOqvot8Fngj/F1OhlW93Xp63UC2gfeXgwcUw99Z+qMuaeG2OnrSmCb9qnaR9Pb5H3+gGvqhLan7SPADVX1r32nzgeGPiH7auALfe2vap+yfQ6wcuhtM/VU1UlV9eSqmkvvtfjVqjoG+BpwZOs2/J4O3esjW/9OrxhMtqr6L+BHSZ7Rmg4ArsfX6dr4IfCcJI9t/x0Yuqe+Ttfe6r4uvwIcnGSjtkJ+cGtTk+QQ4K3AS6rq132nzgde1r49Y2t6H5q7gumYC6rKn2n6A7yQ3icWvw+cPOh6uvID7E3vLZblwLL280J6e90uBr7bfm/c+ofeJz6/D6yg98nmgT+PqfoD7Atc0I6fSu8/rt8DPg08prXPaY+/184/ddB1T8UfYFdgSXutfh7YyNfpWt/TU4AbgWuBjwGP8XW62vfwE/T2FP+W3urfa9fkdUlvn+f32s9rBv28puA9/R69Pa5D/zv1wb7+J7d7ehNwaF/7tMoF/sUuSZIkdY7bCSRJktQ5hlhJkiR1jiFWkiRJnWOIlSRJUucYYiVJktQ5hlhJkiR1jiFWkiRJnWOIlSRJUuf8/0IqX92Pxk19AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8cf9b38>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "tz_counts[:10].plot(kind='barh', rot=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "u'GoogleMaps/RochesterNY'"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "frame['a'][1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "u'Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2'"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "frame['a'][50]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "u'Mozilla/5.0 (Linux; U; Android 2.2.2; en-us; LG-P925/V10e Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1'"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "frame['a'][51]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0               Mozilla/5.0\n",
       "1    GoogleMaps/RochesterNY\n",
       "2               Mozilla/4.0\n",
       "3               Mozilla/5.0\n",
       "4               Mozilla/5.0\n",
       "dtype: object"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "results = Series([x.split()[0] for x in frame.a.dropna()])\n",
    "results[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Mozilla/5.0                 2594\n",
       "Mozilla/4.0                  601\n",
       "GoogleMaps/RochesterNY       121\n",
       "Opera/9.80                    34\n",
       "TEST_INTERNET_AGENT           24\n",
       "GoogleProducer                21\n",
       "Mozilla/6.0                    5\n",
       "BlackBerry8520/5.0.0.681       4\n",
       "dtype: int64"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "results.value_counts()[:8]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [],
   "source": [
    "cframe = frame[frame.a.notnull()]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['Windows', 'Not Windows', 'Windows', 'Not Windows', 'Windows'],\n",
       "      dtype='|S11')"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "operating_system = np.where(cframe['a'].str.contains('Windows'),\n",
    "                            'Windows', 'Not Windows')\n",
    "operating_system[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [],
   "source": [
    "# operating_system提供标签\n",
    "by_tz_os = cframe.groupby(['tz', operating_system])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Not Windows</th>\n",
       "      <th>Windows</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>tz</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <td>245.0</td>\n",
       "      <td>276.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Africa/Cairo</th>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Africa/Casablanca</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Africa/Ceuta</th>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Africa/Johannesburg</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Africa/Lusaka</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Anchorage</th>\n",
       "      <td>4.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Argentina/Buenos_Aires</th>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Argentina/Cordoba</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Argentina/Mendoza</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Bogota</th>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Caracas</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Chicago</th>\n",
       "      <td>115.0</td>\n",
       "      <td>285.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Chihuahua</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Costa_Rica</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Denver</th>\n",
       "      <td>132.0</td>\n",
       "      <td>59.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Edmonton</th>\n",
       "      <td>2.0</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Guayaquil</th>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Halifax</th>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Indianapolis</th>\n",
       "      <td>8.0</td>\n",
       "      <td>12.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/La_Paz</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Lima</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Los_Angeles</th>\n",
       "      <td>130.0</td>\n",
       "      <td>252.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Managua</th>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Mazatlan</th>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Mexico_City</th>\n",
       "      <td>7.0</td>\n",
       "      <td>8.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Monterrey</th>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Montevideo</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Montreal</th>\n",
       "      <td>3.0</td>\n",
       "      <td>6.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/New_York</th>\n",
       "      <td>339.0</td>\n",
       "      <td>912.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Berlin</th>\n",
       "      <td>9.0</td>\n",
       "      <td>19.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Bratislava</th>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Brussels</th>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Bucharest</th>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Budapest</th>\n",
       "      <td>0.0</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Copenhagen</th>\n",
       "      <td>2.0</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Dublin</th>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Helsinki</th>\n",
       "      <td>2.0</td>\n",
       "      <td>8.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Lisbon</th>\n",
       "      <td>1.0</td>\n",
       "      <td>7.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Ljubljana</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/London</th>\n",
       "      <td>43.0</td>\n",
       "      <td>31.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Madrid</th>\n",
       "      <td>16.0</td>\n",
       "      <td>19.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Malta</th>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Moscow</th>\n",
       "      <td>1.0</td>\n",
       "      <td>9.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Oslo</th>\n",
       "      <td>2.0</td>\n",
       "      <td>8.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Paris</th>\n",
       "      <td>4.0</td>\n",
       "      <td>10.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Prague</th>\n",
       "      <td>3.0</td>\n",
       "      <td>7.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Riga</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Rome</th>\n",
       "      <td>8.0</td>\n",
       "      <td>19.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Skopje</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Sofia</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Stockholm</th>\n",
       "      <td>2.0</td>\n",
       "      <td>12.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Uzhgorod</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Vienna</th>\n",
       "      <td>3.0</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Vilnius</th>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Volgograd</th>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Warsaw</th>\n",
       "      <td>1.0</td>\n",
       "      <td>15.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Zurich</th>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pacific/Auckland</th>\n",
       "      <td>3.0</td>\n",
       "      <td>8.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pacific/Honolulu</th>\n",
       "      <td>0.0</td>\n",
       "      <td>36.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>97 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                Not Windows  Windows\n",
       "tz                                                  \n",
       "                                      245.0    276.0\n",
       "Africa/Cairo                            0.0      3.0\n",
       "Africa/Casablanca                       0.0      1.0\n",
       "Africa/Ceuta                            0.0      2.0\n",
       "Africa/Johannesburg                     0.0      1.0\n",
       "Africa/Lusaka                           0.0      1.0\n",
       "America/Anchorage                       4.0      1.0\n",
       "America/Argentina/Buenos_Aires          1.0      0.0\n",
       "America/Argentina/Cordoba               0.0      1.0\n",
       "America/Argentina/Mendoza               0.0      1.0\n",
       "America/Bogota                          1.0      2.0\n",
       "America/Caracas                         0.0      1.0\n",
       "America/Chicago                       115.0    285.0\n",
       "America/Chihuahua                       1.0      1.0\n",
       "America/Costa_Rica                      0.0      1.0\n",
       "America/Denver                        132.0     59.0\n",
       "America/Edmonton                        2.0      4.0\n",
       "America/Guayaquil                       2.0      0.0\n",
       "America/Halifax                         1.0      3.0\n",
       "America/Indianapolis                    8.0     12.0\n",
       "America/La_Paz                          0.0      1.0\n",
       "America/Lima                            0.0      1.0\n",
       "America/Los_Angeles                   130.0    252.0\n",
       "America/Managua                         0.0      3.0\n",
       "America/Mazatlan                        1.0      0.0\n",
       "America/Mexico_City                     7.0      8.0\n",
       "America/Monterrey                       1.0      0.0\n",
       "America/Montevideo                      0.0      1.0\n",
       "America/Montreal                        3.0      6.0\n",
       "America/New_York                      339.0    912.0\n",
       "...                                     ...      ...\n",
       "Europe/Berlin                           9.0     19.0\n",
       "Europe/Bratislava                       1.0      2.0\n",
       "Europe/Brussels                         1.0      3.0\n",
       "Europe/Bucharest                        1.0      3.0\n",
       "Europe/Budapest                         0.0      5.0\n",
       "Europe/Copenhagen                       2.0      3.0\n",
       "Europe/Dublin                           1.0      2.0\n",
       "Europe/Helsinki                         2.0      8.0\n",
       "Europe/Lisbon                           1.0      7.0\n",
       "Europe/Ljubljana                        0.0      1.0\n",
       "Europe/London                          43.0     31.0\n",
       "Europe/Madrid                          16.0     19.0\n",
       "Europe/Malta                            0.0      2.0\n",
       "Europe/Moscow                           1.0      9.0\n",
       "Europe/Oslo                             2.0      8.0\n",
       "Europe/Paris                            4.0     10.0\n",
       "Europe/Prague                           3.0      7.0\n",
       "Europe/Riga                             1.0      1.0\n",
       "Europe/Rome                             8.0     19.0\n",
       "Europe/Skopje                           0.0      1.0\n",
       "Europe/Sofia                            0.0      1.0\n",
       "Europe/Stockholm                        2.0     12.0\n",
       "Europe/Uzhgorod                         0.0      1.0\n",
       "Europe/Vienna                           3.0      3.0\n",
       "Europe/Vilnius                          0.0      2.0\n",
       "Europe/Volgograd                        0.0      1.0\n",
       "Europe/Warsaw                           1.0     15.0\n",
       "Europe/Zurich                           4.0      0.0\n",
       "Pacific/Auckland                        3.0      8.0\n",
       "Pacific/Honolulu                        0.0     36.0\n",
       "\n",
       "[97 rows x 2 columns]"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "agg_counts = by_tz_os.size().unstack().fillna(0)\n",
    "agg_counts[:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tz\n",
       "                                  24\n",
       "Africa/Cairo                      20\n",
       "Africa/Casablanca                 21\n",
       "Africa/Ceuta                      92\n",
       "Africa/Johannesburg               87\n",
       "Africa/Lusaka                     53\n",
       "America/Anchorage                 54\n",
       "America/Argentina/Buenos_Aires    57\n",
       "America/Argentina/Cordoba         26\n",
       "America/Argentina/Mendoza         55\n",
       "dtype: int64"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Use to sort in ascending order\n",
    "# 对于每一行求和\n",
    "indexer = agg_counts.sum(1).argsort()\n",
    "indexer[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Not Windows</th>\n",
       "      <th>Windows</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>tz</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>America/Sao_Paulo</th>\n",
       "      <td>13.0</td>\n",
       "      <td>20.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Madrid</th>\n",
       "      <td>16.0</td>\n",
       "      <td>19.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pacific/Honolulu</th>\n",
       "      <td>0.0</td>\n",
       "      <td>36.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Asia/Tokyo</th>\n",
       "      <td>2.0</td>\n",
       "      <td>35.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/London</th>\n",
       "      <td>43.0</td>\n",
       "      <td>31.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Denver</th>\n",
       "      <td>132.0</td>\n",
       "      <td>59.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Los_Angeles</th>\n",
       "      <td>130.0</td>\n",
       "      <td>252.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Chicago</th>\n",
       "      <td>115.0</td>\n",
       "      <td>285.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <td>245.0</td>\n",
       "      <td>276.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/New_York</th>\n",
       "      <td>339.0</td>\n",
       "      <td>912.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                     Not Windows  Windows\n",
       "tz                                       \n",
       "America/Sao_Paulo           13.0     20.0\n",
       "Europe/Madrid               16.0     19.0\n",
       "Pacific/Honolulu             0.0     36.0\n",
       "Asia/Tokyo                   2.0     35.0\n",
       "Europe/London               43.0     31.0\n",
       "America/Denver             132.0     59.0\n",
       "America/Los_Angeles        130.0    252.0\n",
       "America/Chicago            115.0    285.0\n",
       "                           245.0    276.0\n",
       "America/New_York           339.0    912.0"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "count_subset = agg_counts.take(indexer)[-10:]\n",
    "count_subset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.figure.Figure at 0x832ff28>"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.figure.Figure at 0x832ff28>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x88be550>"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEU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tqg4bYP+LgIOr6v61WtggGjN+yxp/yPHPal/S1fOzdD3MXb6WKpIkSepdkoXNiwL61Qkzv8NCVb1xqGuQJEnqdIbf1VRVpwGnDXEZkiRJWgWd/IE3SZIkdRhnftWnSS8dx4Jj39LLEdf0SpKkdZMzv5IkSeoYhl9JkiR1DJc9SJIk9eHPf/4z9957L3/84x+HuhQ1urq6eNnLXsbznve81Trf8CtJktSHe++9lw033JAJEybQfMGVhlBV8eCDD3LvvfeyxRZbrNYYLnuQJEnqwx//+Ec22WQTg+8wkYRNNtlkjWbiDb+SJEn9MPgOL2v652H4lSRJGsaS8MlPfvKp/c9//vPMnTu333POOeccbrnllme1P/zww2yyySZUFQBXXnklSbj33nsBWL58ORtvvDFPPvkk//RP/8TPfvazVap1woQJLF26dJXOea655leSJGmAJhx5/qCOt6TX9+k/05gxYzj77LM56qij2HTTTQc07jnnnMNb3/pWttlmm2e0v+hFL+Iv//IvufXWW9lmm22YP38+U6dOZf78+RxwwAFcddVV7Ljjjqy33nr88z//82rd03DnzK8kSdIwNnr0aA499FC++MUvPuvY3Xffze67787kyZPZfffdueeee5g/fz7nnnsuf/u3f8uUKVO44447nnHOzJkzmT9/PgDz58/niCOOeMb+jBkzAJgzZw4/+MEPgNaM7tFHH822227LpEmTuO222wB48MEH2XPPPZk6dSp/8zd/89SMMsAXvvAFJk6cyMSJEzn++OMB+I//+A9OPPFEAI444gje8IY3AHDxxRfznve8hxUrVjBnzhwmTpzIpEmTer3nNWX4lSRJGuY+8pGPcMYZZ7B8+TO/ZfWwww7j4IMPZtGiRRx00EEcfvjhzJgxg7e97W0cd9xx3HDDDbzqVa96xjkzZsx4KuzeeeedvPOd72TBggVAK/zOnDmz1xo23XRTrrvuOj784Q/z+c9/HoBjjjmGnXfemeuvv563ve1t3HPPPQAsXLiQefPmcfXVV3PVVVfx9a9/neuvv55ddtmFyy+/HIAFCxbwyCOP8Oc//5krrriCWbNmccMNN3Dfffdx0003sXjxYt73vvcN3kNsGH4lSZKG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eB1yhPV2Ia6DezDfE9kMVUebpyjeblfWDAzLrjjvxA9Ekws6PAeWDY3X/lTpWBE/E0kl7SZsIndGJd4O5qagsaMEjaAToFlFp9Pe3SgAOkqaAXwPNog6S1fA+A9/G6NcYbaQftFPCStFO85Z9jtTbgIHA33veRvpQrwE2gK/rXx3Elzve1+rpXYwN2A88iV28D3crTFcf0IvAWeAVcB7qUpw3H8AZpzfQc6W7j2eXkJWkdayXa6VZ/rlUY0wppDW/2O3U1N74UMX0HHMv1d1RdoH94ExEREZHC0LIHERERESkMFb8iIiIiUhgqfkVERESkMFT8ioiIiEhhqPgVERERkcJQ8SsiIiIihaHiV0REREQKQ8WviIiIiBTGbzXDP1tzgdoNAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x830b550>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "count_subset.plot(kind='barh', stacked=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8cf9358>"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8cf9358>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# div 变成百分比agg_counts\n",
    "normed_subset = count_subset.div(count_subset.sum(1), axis=0)\n",
    "normed_subset.plot(kind='barh', stacked=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## MovieLens 1M data set"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import os\n",
    "encoding = 'latin1'\n",
    "\n",
    "upath = os.path.expanduser('ch02/movielens/users.dat')\n",
    "rpath = os.path.expanduser('ch02/movielens/ratings.dat')\n",
    "mpath = os.path.expanduser('ch02/movielens/movies.dat')\n",
    "\n",
    "unames = ['user_id', 'gender', 'age', 'occupation', 'zip']\n",
    "rnames = ['user_id', 'movie_id', 'rating', 'timestamp']\n",
    "mnames = ['movie_id', 'title', 'genres']\n",
    "\n",
    "users = pd.read_csv(upath, sep='::', header=None, names=unames, encoding=encoding)\n",
    "ratings = pd.read_csv(rpath, sep='::', header=None, names=rnames, encoding=encoding)\n",
    "movies = pd.read_csv(mpath, sep='::', header=None, names=mnames, encoding=encoding)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "users[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ratings[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "movies[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ratings"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.merge(pd.merge(ratings, users), movies)\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "data.ix[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "mean_ratings = data.pivot_table('rating', index='title',\n",
    "                                columns='gender', aggfunc='mean')\n",
    "mean_ratings[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ratings_by_title = data.groupby('title').size()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ratings_by_title[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "active_titles = ratings_by_title.index[ratings_by_title >= 250]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "active_titles[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "mean_ratings = mean_ratings.ix[active_titles]\n",
    "mean_ratings"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "mean_ratings = mean_ratings.rename(index={'Seven Samurai (The Magnificent Seven) (Shichinin no samurai) (1954)':\n",
    "                           'Seven Samurai (Shichinin no samurai) (1954)'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "top_female_ratings = mean_ratings.sort_index(by='F', ascending=False)\n",
    "top_female_ratings[:10]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Measuring rating disagreement"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "mean_ratings['diff'] = mean_ratings['M'] - mean_ratings['F']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "sorted_by_diff = mean_ratings.sort_index(by='diff')\n",
    "sorted_by_diff[:15]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Reverse order of rows, take first 15 rows\n",
    "sorted_by_diff[::-1][:15]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Standard deviation of rating grouped by title\n",
    "rating_std_by_title = data.groupby('title')['rating'].std()\n",
    "# Filter down to active_titles\n",
    "rating_std_by_title = rating_std_by_title.ix[active_titles]\n",
    "# Order Series by value in descending order\n",
    "rating_std_by_title.order(ascending=False)[:10]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### US Baby Names 1880-2010"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from __future__ import division\n",
    "from numpy.random import randn\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "plt.rc('figure', figsize=(12, 5))\n",
    "np.set_printoptions(precision=4)\n",
    "%pwd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "http://www.ssa.gov/oact/babynames/limits.html"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!head -n 10 ch02/names/yob1880.txt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "names1880 = pd.read_csv('ch02/names/yob1880.txt', names=['name', 'sex', 'births'])\n",
    "names1880"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "names1880.groupby('sex').births.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 2010 is the last available year right now\n",
    "years = range(1880, 2011)\n",
    "\n",
    "pieces = []\n",
    "columns = ['name', 'sex', 'births']\n",
    "\n",
    "for year in years:\n",
    "    path = 'ch02/names/yob%d.txt' % year\n",
    "    frame = pd.read_csv(path, names=columns)\n",
    "\n",
    "    frame['year'] = year\n",
    "    pieces.append(frame)\n",
    "\n",
    "# Concatenate everything into a single DataFrame\n",
    "names = pd.concat(pieces, ignore_index=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "total_births = names.pivot_table('births', index='year',\n",
    "                                 columns='sex', aggfunc=sum)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "total_births.tail()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "total_births.plot(title='Total births by sex and year')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def add_prop(group):\n",
    "    # Integer division floors\n",
    "    births = group.births.astype(float)\n",
    "\n",
    "    group['prop'] = births / births.sum()\n",
    "    return group\n",
    "names = names.groupby(['year', 'sex']).apply(add_prop)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "names"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "np.allclose(names.groupby(['year', 'sex']).prop.sum(), 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_top1000(group):\n",
    "    return group.sort_index(by='births', ascending=False)[:1000]\n",
    "grouped = names.groupby(['year', 'sex'])\n",
    "top1000 = grouped.apply(get_top1000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "pieces = []\n",
    "for year, group in names.groupby(['year', 'sex']):\n",
    "    pieces.append(group.sort_index(by='births', ascending=False)[:1000])\n",
    "top1000 = pd.concat(pieces, ignore_index=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "top1000.index = np.arange(len(top1000))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "top1000"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Analyzing naming trends"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "boys = top1000[top1000.sex == 'M']\n",
    "girls = top1000[top1000.sex == 'F']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "total_births = top1000.pivot_table('births', index='year', columns='name',\n",
    "                                   aggfunc=sum)\n",
    "total_births"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "subset = total_births[['John', 'Harry', 'Mary', 'Marilyn']]\n",
    "subset.plot(subplots=True, figsize=(12, 10), grid=False,\n",
    "            title=\"Number of births per year\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Measuring the increase in naming diversity"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.figure()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "table = top1000.pivot_table('prop', index='year',\n",
    "                            columns='sex', aggfunc=sum)\n",
    "table.plot(title='Sum of table1000.prop by year and sex',\n",
    "           yticks=np.linspace(0, 1.2, 13), xticks=range(1880, 2020, 10))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = boys[boys.year == 2010]\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "prop_cumsum = df.sort_index(by='prop', ascending=False).prop.cumsum()\n",
    "prop_cumsum[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "prop_cumsum.values.searchsorted(0.5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = boys[boys.year == 1900]\n",
    "in1900 = df.sort_index(by='prop', ascending=False).prop.cumsum()\n",
    "in1900.values.searchsorted(0.5) + 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_quantile_count(group, q=0.5):\n",
    "    group = group.sort_index(by='prop', ascending=False)\n",
    "    return group.prop.cumsum().values.searchsorted(q) + 1\n",
    "\n",
    "diversity = top1000.groupby(['year', 'sex']).apply(get_quantile_count)\n",
    "diversity = diversity.unstack('sex')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_quantile_count(group, q=0.5):\n",
    "    group = group.sort_index(by='prop', ascending=False)\n",
    "    return group.prop.cumsum().values.searchsorted(q) + 1\n",
    "diversity = top1000.groupby(['year', 'sex']).apply(get_quantile_count)\n",
    "diversity = diversity.unstack('sex')\n",
    "diversity.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "diversity.plot(title=\"Number of popular names in top 50%\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### The \"Last letter\" Revolution"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# extract last letter from name column\n",
    "get_last_letter = lambda x: x[-1]\n",
    "last_letters = names.name.map(get_last_letter)\n",
    "last_letters.name = 'last_letter'\n",
    "\n",
    "table = names.pivot_table('births', index=last_letters,\n",
    "                          columns=['sex', 'year'], aggfunc=sum)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "subtable = table.reindex(columns=[1910, 1960, 2010], level='year')\n",
    "subtable.head()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "subtable.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "letter_prop = subtable / subtable.sum().astype(float)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "fig, axes = plt.subplots(2, 1, figsize=(10, 8))\n",
    "letter_prop['M'].plot(kind='bar', rot=0, ax=axes[0], title='Male')\n",
    "letter_prop['F'].plot(kind='bar', rot=0, ax=axes[1], title='Female',\n",
    "                      legend=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.subplots_adjust(hspace=0.25)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "letter_prop = table / table.sum().astype(float)\n",
    "\n",
    "dny_ts = letter_prop.ix[['d', 'n', 'y'], 'M'].T\n",
    "dny_ts.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.close('all')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "dny_ts.plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Boy names that became girl names (and vice versa)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "all_names = top1000.name.unique()\n",
    "mask = np.array(['lesl' in x.lower() for x in all_names])\n",
    "lesley_like = all_names[mask]\n",
    "lesley_like"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "filtered = top1000[top1000.name.isin(lesley_like)]\n",
    "filtered.groupby('name').births.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "table = filtered.pivot_table('births', index='year',\n",
    "                             columns='sex', aggfunc='sum')\n",
    "table = table.div(table.sum(1), axis=0)\n",
    "table.tail()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.close('all')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "table.plot(style={'M': 'k-', 'F': 'k--'})"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
